load("@rules_rust//rust:defs.bzl", "rust_library", "rust_test_suite")
load("//bazel:defs.bzl", "rust_bench")

package(default_visibility = ["//rs/crypto:__subpackages__"])

DEPENDENCIES = [
    # Keep sorted.
    "//rs/crypto/internal/crypto_lib/bls12_381/type",
    "@crate_index//:rand",
]

MACRO_DEPENDENCIES = []

DEV_DEPENDENCIES = [
    # Keep sorted.
    "//rs/crypto/test_utils/reproducible_rng",
    "@crate_index//:hex",
    "@crate_index//:rand_chacha",
]

MACRO_DEV_DEPENDENCIES = []

ALIASES = {}

rust_library(
    name = "vetkd",
    srcs = glob(["src/**"]),
    aliases = ALIASES,
    crate_name = "ic_crypto_internal_bls12_381_vetkd",
    proc_macro_deps = MACRO_DEPENDENCIES,
    version = "0.1.0",
    deps = DEPENDENCIES,
)

rust_test_suite(
    name = "integration",
    srcs = glob(["tests/**/*.rs"]),
    proc_macro_deps = MACRO_DEPENDENCIES + MACRO_DEV_DEPENDENCIES,
    deps = [":vetkd"] + DEPENDENCIES + DEV_DEPENDENCIES,
)

rust_bench(
    name = "vetkd_bench",
    testonly = True,
    srcs = ["benches/vetkd.rs"],
    deps = [
        # Keep sorted.
        ":vetkd",
        "//rs/crypto/internal/crypto_lib/bls12_381/type",
        "//rs/crypto/test_utils/reproducible_rng",
        "@crate_index//:criterion",
        "@crate_index//:rand",
    ],
)
